CREATE TABLE [dbo].[tb_TiposDeServicios]
(
[idTipoDeServicio] [int] NOT NULL IDENTITY(1, 1),
[Descripcion] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TRIGGER [dbo].[updateTipoServicio] ON [dbo].[tb_TiposDeServicios] 
FOR UPDATE
AS
if (update(idTipoDeServicio)) begin
	UPDATE tb_Servicios
	SET TipoServicio = (SELECT idTipoDeServicio from inserted)
	WHERE TipoServicio in (SELECT idTipoDeServicio from deleted)
end
GO
ALTER TABLE [dbo].[tb_TiposDeServicios] ADD CONSTRAINT [PK_tb_TiposDeServicios] PRIMARY KEY NONCLUSTERED  ([idTipoDeServicio]) ON [PRIMARY]
GO
